define(['zepto', 'wx' , 'wxConfig'],function($, wx){
	return{

		modal: {},

		openShare: function(title,description){

			this.modal.title = title
			this.modal.description =description
			this.wxshowshare();
						
		},
		
		disableShare: function(){
			wx.ready(function(){

				wx.hideMenuItems({
				//要隐藏的微信分享接口
   				 menuList: ['menuItem:share:appMessage',
						    'menuItem:share:timeline',
                            'menuItem:share:qq',
              				'menuItem:share:weiboApp',
             				'menuItem:share:QZone'
   				 ]
				});
			})

			wx.error(function(res){
				console.log(res)
			})	
		},


		//执行微信api
		wxshowshare: function(){
			
			var that = this
			//ready
			wx.ready(function(){
			//分享朋友圈，分享好友，分享qq，分享空间，分享微博
			wx.onMenuShareTimeline(that.wxshare())
			wx.onMenuShareAppMessage(that.wxshare())
			wx.onMenuShareQQ(that.wxshare())
			wx.onMenuShareQZone(that.wxshare())
			wx.onMenuShareWeibo(that.wxshare())
			});
			
			//error
			wx.error(function(res){
				console.log(res)
			})
		},
		
		wxshare: function(){
			var that = this;
			return {
				title: that.modal.title,
				desc: that.modal.description
			}
		},



		
	}
});